/**
 * 
 */
package com.yunyike.constants;

/**
 * @author zhengqiang.shi
 * 2016-4-11 下午4:51:01
 */
public enum EnumPromotionType {

	/**
	 * 满减 0， 包邮 1，直降2， 满返 3， 满增 4， 加价购 5， 买赠 6， 买返 7
	 */
	
	FULL_CUT(0),
	FREE_SHIPPING(1),
	PRICE_DOWN(2);

	int promotionType;
	
	private EnumPromotionType(int promotionType) {
		this.promotionType = promotionType; 
	}

	public int getPromotionType() {
		return promotionType;
	}

	public void setPromotionType(int promotionType) {
		this.promotionType = promotionType;
	}
	
	public static EnumPromotionType getPromotionType(int pomotionType){
		EnumPromotionType[] values = EnumPromotionType.values();
		
		for (EnumPromotionType enumPromotionType : values) {
			if(pomotionType == enumPromotionType.getPromotionType()){
				return enumPromotionType;
			}
		}
		return null;
	}
}
